home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Windows / WindowInitializer.h < prev    next >
Text File  |  1997-06-28  |  2KB  |  61 lines

  1. // WindowInitializer.h
  2.  
  3. #ifndef WindowInitializer_h
  4. #define WindowInitializer_h
  5.  
  6. #ifndef Rectangle_h
  7. #include "Rectangle.h"
  8. #endif
  9. #ifndef Str_h
  10. #include "Str.h"
  11. #endif
  12.  
  13. class WindowDefinition;
  14. class WindowDefaults;
  15.  
  16. class WindowInitializer
  17.   {
  18.     private:
  19.         bool useDefaultScreen;
  20.         GDHandle screen;
  21.         
  22.         bool useDefaultPosition;
  23.         Rectangle position;
  24.         
  25.         bool useDefaultName;
  26.         String255 name;            // mutable
  27.  
  28.         bool useDefaultIndex;
  29.         uint32 index;
  30.         
  31.         bool useDefaultVisibility;
  32.         bool visible;
  33.         
  34.     public:
  35.         WindowInitializer();
  36.  
  37.         void SetScreen( GDHandle s )                    { screen = s; useDefaultScreen = false; }
  38.         void UseDefaultScreen()                            { useDefaultScreen = true; }
  39.         GDHandle ScreenFor( const WindowDefaults& ) const;
  40.         
  41.         void SetPosition( const Rectangle& r )        { position = r; useDefaultPosition = false; }
  42.         void UseDefaultPosition()                        { useDefaultPosition = true; }
  43.         Rectangle PositionFor( const WindowDefaults& ) const;
  44.  
  45.         void SetName( ConstPString n )                { name = n; useDefaultName = false; }
  46.         void UseDefaultName()                            { useDefaultName = true; }
  47.         ConstPString NameFor( const WindowDefaults& ) const;
  48.  
  49.         void SetIndex( uint32 i )                        { index = i; useDefaultIndex = false; }
  50.         void UseDefaultIndex()                            { useDefaultIndex = true; }
  51.         uint32 IndexFor( const WindowDefaults& ) const;
  52.  
  53.         void BeVisible()                                    { visible = true; useDefaultVisibility = false; }
  54.         void BeHidden()                                    { visible = false; useDefaultVisibility = false; }
  55.         void SetVisibility( bool v )                    { visible = v; useDefaultVisibility = false; }
  56.         void UseDefaultVisibility()                    { useDefaultVisibility = true; }
  57.         bool VisibilityFor( const WindowDefaults& ) const;
  58.   };
  59.  
  60. #endif
  61.